Customizing one place

  • Harlock
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #11576 by Harlock
Customizing one place was created by Harlock
Hi Dmitry,

As expected, here I am again :-)

I am happy to say that so far I could do most of what I wanted to do with Zh Google Maps.
But now I am a little stuck about the rest. Probably mostly because I'm not really familiar with Google maps options and terms. So I think I should expose you my project, then you could maybe show me the right way/strategy to handle this.

My project is quite simple actually. No weather, no geolocation or travel instructions.

Only a "simple" map of a part of my city. I will probably use styles to customize colors. In the middle of this map, you can see my client's business tag. And of course, all around this, other businesses tags.

What I'd like to do is to customize my client's tag and maybe infobubble (content and appearance).

I've tried to create a placemark and even added my own png file. It seems to work great. Except that the location is not accurate. If I zoom in or out, this icon is not on top of the actual location. It moves up or down. Which is a real issue for me.

If I use the original map title in a marker (the red drop), it's far better. But I'm not sure I can customize this marker, right ?

Actually, the only element that is precisely at the right place in all situations and zoomings is the original Google map marker showing my client's business (small pictogram in a circle and the company name next to it).

So I guess you get it : I'd like to be able to customize my client's tag as much as possible (company logo for instance or a circle) but keeping an accurate location in every situation.

Then what I'd be happy to get from you is your advice about where I should start. Working the title marker ? Working a custom marker ? Or maybe is there a way to customize my client's icon which is already on Google map and behaving perfectly ?

Then is that possible to customize other businesses all around the area to make them more discreet (without erasing them completely) ?

I really hope you can help me on this ! Thanks in advance !

Harlock

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago - 5 years 11 months ago #11577 by Dima
Replied by Dima on topic Customizing one place
Hi Harlock
As I understand you right, you have one problem - your custom icon doesn't correct point to your position.
OK. lets step by step do it.
I put into predefined icon list 3 types of icons
started with default#
started with gm#
started with mapiconscollection
All of it has bottom center anchor position.

Lets take gm#dot-red
It is like default Google Maps icon. Its bottom points to your position.
By default I use bottom center position of marker image (icon) to point to your place.
Due to if you create placemark and point to your place (by definition of latitude and longitude), when you change zoom your placemark still points to your position.

Now if you upload your png image, you can use it. And, by default, it will point to your place by bottom center too.
If your pointer doesn't correct points to position there are 2 cases. It is not points by bottom center, or in your CSS styles exist some padding or other styles, which can break img tag attributes.
As for first case (your logo file doesn't have bottom center, probably you want to do offsets). In this case in placemark details on Appearance tab you have "Icon X-offset" and "Icon Y-offset". You can enter integer numbers to move anchor, for example,
Icon X-offset = -3 means move anchor to the left to 3px.
In this case offsets help you to correct anchor of your placemark to your expected positions. But you should remember for your own custom icons - if you change icon - you should analyze and change offsets in case it can has different anchor position.

As for second case - I need direct link to page with map to analyze what you have and what you expect.

Don't forget support my developments: post review in JED , donate , help with translation ;)
Last edit: 5 years 11 months ago by Dima.

Please Log in or Create an account to join the conversation.

  • Harlock
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #11578 by Harlock
Replied by Harlock on topic Customizing one place
Hi Dmitry,

Many thanks for your answer and detailed explanations. This is very clear in theory. I was not aware of this anchor system and this makes perfect sense why I have this issue.

Unfortunately, changing the Y offset doesn't seem yo make any change in my position mark icon. I even tried this with one standard icon, same result.

The weird thing is that, as a second option, I edited my own custom PNG file, making a transparent zone on top, which would be supposed to replace your y-offset parameter, correct ? And actually even this second image is on the same place on the map. Any idea of what happens ? I mean even if I had CSS causing the problem, this new image should fix the problem…

Please Log in or Create an account to join the conversation.

  • Harlock
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 11 months ago #11579 by Harlock
Replied by Harlock on topic Customizing one place
OK, my idea of creating a transparent zone was stupid. Bottom center remains bottom center, haha.
But still, changing y-offset doesn't change anything. Even clearing the Joomla cache.
Wondering what's happening.

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #11580 by Dima
Replied by Dima on topic Customizing one place
Changing Y offset have to change icon position. For example set it to -100 and you'll see that it moved up to 100px
As for transparent zone. As you can understand, vertical size calculated at all, it is not calculate only visible part. In this case if you need transparent, you need to change Y offset.
As for CSS. It can cause for every images, ie for default or not icons, because if in template CSS defined margins or something else for img tag (without any classes or IDs), it can cause.

If you need more information, give me link to map page and attache image with explanation what you have and what you expect. I can check styles.
You can also mail me This email address is being protected from spambots. You need JavaScript enabled to view it. if you need checking and assistance with admin part.

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #11581 by Dima
Replied by Dima on topic Customizing one place
I found my little mistake. I analyze both x and Y. Now if you set X=1 you'll see changes.
I'll fix it in nearest release (today or tomorrow). Check updates.

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.134 seconds

Donate


Go to top